package com.jfm.jfmc.core.starter;

import com.jfm.jfmc.core.icc.JobControl;
import com.jfm.jfmc.core.service.ICollectTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author DYang
 * @since 2024-10-20 21:18
 *
 * 采集器启动器
 */
@Component
public class CollectStarter implements ApplicationRunner {

    @Autowired
    private ICollectTemplateService collectorTemplateService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        this.buildCollector();

//        JobControl.init();
    }

    /**
     * 构建采集器
     */
    private void buildCollector() {
        collectorTemplateService.buildCollectJob();
    }
}
